package day04;

public class TestArray6{
	public static void main(String[]args){
		//int[] a = new int[2];
		int[][] a = new int[2][3];
		a[0][0] = 1;
		a[0][1] = 2;
		a[0][2] = 3;
		a[1][0] = 4;
		a[1][1] = 5;
		a[1][2] = 6;
		for(int i=0; i<2; i++){
			for(int j=0; j<3; j++){
				System.out.print(a[i][j]+" ");
			}
			System.out.println();
		}
		System.out.println("a.length="+a.length);
		System.out.println("a[0].length="+a[0].length);
		
		int[][] b = new int[2][];
		b[0] = new int[3];
		b[1] = new int[3];
		b[0][0] = 1;
		b[0][1] = 2;
		b[0][2] = 3;
		b[1][0] = 4;
		b[1][1] = 5;
		b[1][2] = 6;
		for(int i=0; i<2; i++){
			for(int j=0; j<3; j++){
				System.out.print(b[i][j]+" ");
			}
			System.out.println();
		}
		
		int[][] c = new int[2][];
		c[0] = new int[3];
		c[1] = new int[4];
		c[0][0] = 1;
		c[0][1] = 2;
		c[0][2] = 3;
		c[1][0] = 4;
		c[1][1] = 5;
		c[1][2] = 6;
		c[1][3] = 7;
		for(int i=0; i<c.length; i++){
			for(int j=0; j<c[i].length; j++){
				System.out.print(c[i][j]+" ");
			}
			System.out.println();
		}
		
		//int[] a = {2,213,2,24,34};
		int[][] d = {{1,2,3},{2,3},{3,4,5,6}};
		for(int i=0; i<d.length; i++){
			for(int j=0; j<d[i].length; j++){
				System.out.print(d[i][j]+"  ");
			}
			System.out.println();
		}
		
		Dog[][] ds = 
		{{new Dog(),new Dog()},
		 {new Dog()},
		 {new Dog(),new Dog(),new Dog()}
		};
		System.out.println(ds.length);
		Dog[][] ds1 = new Dog[3][];
		ds1[0] = new Dog[2];
		ds1[1] = new Dog[1];
		ds1[2] = new Dog[3];
		ds1[0][0] = new Dog();
		ds1[0][1] = new Dog();
		ds1[1][0] = new Dog();
		ds1[2][0] = new Dog();
		ds1[2][1] = new Dog();
		ds1[2][2] = new Dog();
		
	}
}